using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu]
public class GameObjectsList : ScriptableObject
{
	[SerializeField]
	private List<GameObject> gameObjects = new List<GameObject>();

	public int Count => gameObjects.Count + 1;

	public GameObject GetInstance(int i)
	{
		i = Mathf.Abs(i);
		if (i == 0 || gameObjects.Count <= i - 1)
		{
			return null;
		}
		return UnityEngine.Object.Instantiate(gameObjects[i - 1]);
	}
}
